.TH qthread_readFF 3 "APRIL 2011" libqthread "libqthread"
.SH NAME
.B qthread_readFF
\- waits for the source to be full, then copies it
.SH SYNOPSIS
.B #include <qthread.h>

.I int
.br
.B qthread_readFF
.RI "(aligned_t *" dest ", const aligned_t *" src );
.SH DESCRIPTION
This function waits for memory to become full, and then reads it and leaves the
memory as full. When memory becomes full, all threads waiting for it to become
full with a readFF will receive the value at once and will be queued to run.
Data is read from
.I src
and stored in
.IR dest .
.PP
The semantics of readFF are:
.RS
.PP
1 -
.IR src 's
FEB state must be "full"
.br
2 - data is copied from
.I src
to
.I dest
.RE
.SH WARNING
This, and all other FEB-related functions currently operate exclusively on
aligned data. This is to simulate the behavior of the MTA as closely as
possible. The library requires 4- or 8-byte alignment, depending on whether
compiled in 32-bit or 64-bit mode.
.SH RETURN VALUE
On success, the memory address
.I src
is marked full, the address
.I dest
is filled with the contents of
.I src
and 0 is returned. On error, an non-zero error code is returned.
.SH ERRORS
.TP 12
.B ENOMEM
Not enough memory could be allocated for bookkeeping structures.
.SH SEE ALSO
.BR qthread_empty (3),
.BR qthread_fill (3),
.BR qthread_writeEF (3),
.BR qthread_writeF (3),
.BR qthread_readFE (3),
.BR qthread_lock (3),
.BR qthread_unlock (3)
